﻿import 'react-hot-loader'
import { hot } from 'react-hot-loader/root'
import React from 'react'
import ReactDOM from 'react-dom'
// import { Provider } from 'react-redux'
import 'font-awesome/css/font-awesome.css'
import less from 'less'
// import store from '@/store'
import config from '@/config'
import "@/less/paper-preset/preset.less"
import '@/less/style.less'
import { createMuiTheme,MuiThemeProvider } from "@material-ui/core/styles";
import red from '@material-ui/core/colors/red';

import {Provider, observer, inject } from 'mobx-react'
import store from '@/mobx'

var __dirpath;
if(globalThis===window){

}else{
	__dirpath = __path.dirname(node_process.execPath).replace(/\\/g,'/')

	window.__dirpath = process.env.NODE_ENV == 'production' ? __dirpath : '.'
}

const theme = createMuiTheme({
	typography: {
		useNextVariants: true,
	},
	palette: {
		primary: {
			main: "#6fa59d",
			// light: "#6fa59d",
			// dark: "#6fa59d"
		},
		// secondary: pink,
		error: red,
		contrastThreshold: 3,
		tonalOffset: 0.2,
	},
});

if(window)window.store=store


import App from './components/App'


const render = (Component) => {
	ReactDOM.render(
		<MuiThemeProvider  theme={theme}>
			<Provider {...store}>
				<Component/>
			</Provider>
		</MuiThemeProvider>,
		document.getElementById('app-root')
	);
};

render(hot(App))

// if (module.hot){
// 	module.hot.accept('./components/App', () => {
// 		render(App)
// 	});
// }
